<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%
	request.setCharacterEncoding("UTF-8");
	response.setContentType("text/html;charset=UTF-8");
%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	String path = request.getContextPath();
%>
<html lang="zh-cn">
<head>
 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="renderer" content="webkit">
    <title></title>  
    <link rel="stylesheet" href="<%=path %>/admin/css/pintuer.css">
    <link rel="stylesheet" href="<%=path %>/admin/css/admin.css">
    <link rel="stylesheet" href="<%=path %>/admin/css/style.css">
    <script src="<%=path %>/admin/js/jquery.js"></script>
    <script src="<%=path %>/admin/js/pintuer.js"></script>
    <link rel="stylesheet" href="<%=path %>/admin/font-awesome-4.7.0/css/font-awesome.css">
		
</head>
<body>
<form method="get" action="<%=path %>/profit/list" id="listform">

	<input type="hidden" id="totalSize" name="totalSize" value="${totalSize }">
	<input type="hidden" id="pageNo" name="pageNo" value="${pageNo}">
	<input type="hidden" id="authInfo" name="authInfo" value="1">
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder">分销设置列表</strong> <a href="" style="float:right; display:none;">添加字段</a></div>
        <div class="padding border-bottom">
	      <ul class="search" style="padding-left:10px;">
	        <!--<li> <a class="button border-main icon-plus-square-o" href="add.html"> 添加内容</a> </li>-->
	      </ul>
	    </div>
    <table class="table table-hover text-center">
      <tr>
        <th style="text-align:left; padding-left:20px;width:5%">序号</th>
        <th style="width:10%">产品</th>
        <th style="width:10%">一级经销商</th>
        <th style="width:15%">二级经销商</th>
        <th style="width:15%">三级经销商</th>
        <th style="width:15%">四级经销商</th>
        <th style="width:10%">五级经销商</th>
        <th width="310">操作</th>
      </tr>
      <c:forEach items="${List}" var="item" varStatus="vs">  
          	<tr>
			 <td style="text-align:left; padding-left:20px;">
                ${vs.count+pageInfo.startIndex+(pageNo-1)*10}
            </td>
            <td>${item.name}</td>
             <c:forEach items="${item.profitList}" var="profit" varStatus="vs1"> 
            	<td>${profit.value}</td>
             </c:forEach>
			<td>
			    <div class="suspended-pos"><i class="fa fa-edit" onclick="update('${item.id}')"></i><span class="suspended">修改</span></div>
				<%-- <div class="button-group"> 
					<a class="button border-main" href="<%=path %>/profit/update?paltformId=${item.id}"><span class="icon-edit"></span> 查看</a> 
					<a class="button border-red icon-trash-o" href="<%=path %>/profit/delete?paltformId=${item.id}"> 刪除</a> 
				</div> --%>
			</td>       
		</tr>     
	 </c:forEach>
     <c:if test="${empty List}">
		<tr>
        	<td colspan="5" class="t_c">
                <span class="no-records">暂无数据</span>
            </td>
        </tr>
      </c:if>
      <c:if test="${!empty List}">
	<!--    <tr>
	        <td style="text-align:left; padding:19px 0;padding-left:20px;"><input type="checkbox" id="checkall"/>全选 </td>
	        <td colspan="7" style="text-align:left;padding-left:20px;">
		    <a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 修改</a>
		    <a href="javascript:void(0)" class="button border-red icon-trash-o" style="padding:5px 15px;" onclick="DelSelect()"> 删除</a>
	        </td>
	    </tr>  -->
	      <tr>
	        <td colspan="8">
	        	<div id="page" class="page_div"></div>
	        </td>
	      </tr>
	   </c:if>  
    </table>
  </div>
</form>
<script type="text/javascript">
/* 
var pageNo = Number($("#pageNo").val());
var totalSize = Number($("#totalSize").val());
var totalPage = Number(Math.ceil(totalSize/10));
//分页
$("#page").paging({
	pageNo:pageNo,//当前页
	totalPage: totalPage,//总页数
	totalSize: totalSize,//总条数
	callback: function(num) {
		
		$("#pageNo").val(num);
		$("#listform").submit();	
		//		alert(num)
	}
}) */

function update(id){
	window.location.href="<%=path %>/profit/update?paltformId="+id; 
	
}

//搜索
function changesearch(){	
	$("#listform").submit();	
}
//添加
function add(){	
	
	window.location.href="<%=path %>/profit/add"; 
}

//单个删除
function del(id,mid,iscid){
	if(confirm("您确定要删除吗?")){
		
	}
}

//全选
$("#checkall").click(function(){ 
  $("input[name='id[]']").each(function(){
	  if (this.checked) {
		  this.checked = false;
	  }
	  else {
		  this.checked = true;
	  }
  });
})





</script>
</body>
</html>